package com.bdqn.controller;

import com.bdqn.pojo.Department;
import com.bdqn.service.DepartmentService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/department")
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;
    @GetMapping("/getdepartements")
    public PageInfo<Department> selectPage(int pageNum, int pageSize, String deptName){
        PageInfo<Department> pageInfo=departmentService.selectPage(pageNum,pageSize,deptName);
        return pageInfo;
    }

    //查询挂号列表
    @GetMapping("/selectRegistrationList")
    public List<Department> selectRegistrationList(){
        List<Department> list = departmentService.getRegistrationList();
        return list;
    }
}
